# naimath_extras.py

from django import template

from naimath.engine import question

register = template.Library()

@register.filter
def get_question(full_q_name):
    try:
        category, q_name = full_q_name.split(':')
        return question.lookup(category, q_name)
    except Exception:
        return full_q_name
#defaults to this anyway: get_question.is_safe = False
